﻿using System;
using System.Threading.Tasks;

namespace MetaSharp.Transformation
{
    public delegate Task<IMatch> PatternMatch(IScope input);
    public delegate Task<IMatch> CallablePatternMatch(IScope scope, params PatternMatch[] parameters);

    //public delegate TResult Func<TResult>();
    //public delegate TResult Func<T1, TResult>(T1 arg1);
    //public delegate TResult Func<T1, T2, TResult>(T1 arg1, T2 arg2);

    public static class Extensions
	{
        public static string Print(this Delegate method)
        {
            return string.Format(
                "{0}.{1} ({2})",
                method.Method.DeclaringType.Name,
                method.Method.Name,
                method.Target != null ? method.Target.ToString() : "null");
        }
	}
}
